/** @file
 *	@brief MAVLink comm protocol testsuite generated from asctec_sdk_mavlink_types.xml
 *	@see http://qgroundcontrol.org/mavlink/
 */
#ifndef ASCTEC_SDK_MAVLINK_TYPES_TESTSUITE_H
#define ASCTEC_SDK_MAVLINK_TYPES_TESTSUITE_H

#ifdef __cplusplus
extern "C" {
#endif

#ifndef MAVLINK_TEST_ALL
#define MAVLINK_TEST_ALL

static void mavlink_test_asctec_sdk_mavlink_types(uint8_t, uint8_t, mavlink_message_t *last_msg);

static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{

	mavlink_test_asctec_sdk_mavlink_types(system_id, component_id, last_msg);
}
#endif




static void mavlink_test_asctec_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_heartbeat_t packet_in = {
		963497464,
	17443,
	151,
	218,
	29,
	};
	mavlink_asctec_heartbeat_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.msec = packet_in.msec;
        	packet1.cpu_load = packet_in.cpu_load;
        	packet1.sdk_status = packet_in.sdk_status;
        	packet1.control_mode = packet_in.control_mode;
        	packet1.publishing_mode = packet_in.publishing_mode;
        
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_heartbeat_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_heartbeat_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_heartbeat_pack(system_id, component_id, &msg , packet1.msec , packet1.sdk_status , packet1.control_mode , packet1.publishing_mode , packet1.cpu_load );
	mavlink_msg_asctec_heartbeat_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msec , packet1.sdk_status , packet1.control_mode , packet1.publishing_mode , packet1.cpu_load );
	mavlink_msg_asctec_heartbeat_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_heartbeat_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_heartbeat_send(MAVLINK_COMM_1 , packet1.msec , packet1.sdk_status , packet1.control_mode , packet1.publishing_mode , packet1.cpu_load );
	mavlink_msg_asctec_heartbeat_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_imu_t packet_in = {
		963497464,
	963497672,
	963497880,
	963498088,
	963498296,
	963498504,
	963498712,
	963498920,
	963499128,
	963499336,
	963499544,
	963499752,
	963499960,
	963500168,
	};
	mavlink_asctec_imu_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.msec = packet_in.msec;
        	packet1.acc_x = packet_in.acc_x;
        	packet1.acc_y = packet_in.acc_y;
        	packet1.acc_z = packet_in.acc_z;
        	packet1.angle_roll = packet_in.angle_roll;
        	packet1.angle_pitch = packet_in.angle_pitch;
        	packet1.angle_yaw = packet_in.angle_yaw;
        	packet1.angvel_roll = packet_in.angvel_roll;
        	packet1.angvel_pitch = packet_in.angvel_pitch;
        	packet1.angvel_yaw = packet_in.angvel_yaw;
        	packet1.Hx = packet_in.Hx;
        	packet1.Hy = packet_in.Hy;
        	packet1.Hz = packet_in.Hz;
        	packet1.fusion_height = packet_in.fusion_height;
        
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_imu_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_imu_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_imu_pack(system_id, component_id, &msg , packet1.msec , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.angle_roll , packet1.angle_pitch , packet1.angle_yaw , packet1.angvel_roll , packet1.angvel_pitch , packet1.angvel_yaw , packet1.Hx , packet1.Hy , packet1.Hz , packet1.fusion_height );
	mavlink_msg_asctec_imu_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msec , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.angle_roll , packet1.angle_pitch , packet1.angle_yaw , packet1.angvel_roll , packet1.angvel_pitch , packet1.angvel_yaw , packet1.Hx , packet1.Hy , packet1.Hz , packet1.fusion_height );
	mavlink_msg_asctec_imu_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_imu_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_imu_send(MAVLINK_COMM_1 , packet1.msec , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.angle_roll , packet1.angle_pitch , packet1.angle_yaw , packet1.angvel_roll , packet1.angvel_pitch , packet1.angvel_yaw , packet1.Hx , packet1.Hy , packet1.Hz , packet1.fusion_height );
	mavlink_msg_asctec_imu_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_gps_t packet_in = {
		963497464,
	963497672,
	963497880,
	963498088,
	963498296,
	963498504,
	963498712,
	963498920,
	963499128,
	19107,
	19211,
	125,
	192,
	};
	mavlink_asctec_gps_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.msec = packet_in.msec;
        	packet1.GPS_longitude = packet_in.GPS_longitude;
        	packet1.GPS_height = packet_in.GPS_height;
        	packet1.GPS_position_accuracy = packet_in.GPS_position_accuracy;
        	packet1.GPS_height_accuracy = packet_in.GPS_height_accuracy;
        	packet1.GPS_speed_x = packet_in.GPS_speed_x;
        	packet1.GPS_speed_y = packet_in.GPS_speed_y;
        	packet1.GPS_heading = packet_in.GPS_heading;
        	packet1.GPS_time_of_week = packet_in.GPS_time_of_week;
        	packet1.GPS_latitude = packet_in.GPS_latitude;
        	packet1.GPS_week = packet_in.GPS_week;
        	packet1.GPS_status = packet_in.GPS_status;
        	packet1.GPS_sat_num = packet_in.GPS_sat_num;
        
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_gps_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_gps_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_gps_pack(system_id, component_id, &msg , packet1.msec , packet1.GPS_status , packet1.GPS_latitude , packet1.GPS_longitude , packet1.GPS_height , packet1.GPS_position_accuracy , packet1.GPS_height_accuracy , packet1.GPS_speed_x , packet1.GPS_speed_y , packet1.GPS_heading , packet1.GPS_sat_num , packet1.GPS_time_of_week , packet1.GPS_week );
	mavlink_msg_asctec_gps_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_gps_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msec , packet1.GPS_status , packet1.GPS_latitude , packet1.GPS_longitude , packet1.GPS_height , packet1.GPS_position_accuracy , packet1.GPS_height_accuracy , packet1.GPS_speed_x , packet1.GPS_speed_y , packet1.GPS_heading , packet1.GPS_sat_num , packet1.GPS_time_of_week , packet1.GPS_week );
	mavlink_msg_asctec_gps_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_gps_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_gps_send(MAVLINK_COMM_1 , packet1.msec , packet1.GPS_status , packet1.GPS_latitude , packet1.GPS_longitude , packet1.GPS_height , packet1.GPS_position_accuracy , packet1.GPS_height_accuracy , packet1.GPS_speed_x , packet1.GPS_speed_y , packet1.GPS_heading , packet1.GPS_sat_num , packet1.GPS_time_of_week , packet1.GPS_week );
	mavlink_msg_asctec_gps_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_motor_rpm(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_motor_rpm_t packet_in = {
		963497464,
	{ 17, 18, 19, 20 },
	};
	mavlink_asctec_motor_rpm_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.msec = packet_in.msec;
        
        	mav_array_memcpy(packet1.motor, packet_in.motor, sizeof(uint8_t)*4);
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_rpm_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_motor_rpm_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_rpm_pack(system_id, component_id, &msg , packet1.msec , packet1.motor );
	mavlink_msg_asctec_motor_rpm_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_rpm_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msec , packet1.motor );
	mavlink_msg_asctec_motor_rpm_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_motor_rpm_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_rpm_send(MAVLINK_COMM_1 , packet1.msec , packet1.motor );
	mavlink_msg_asctec_motor_rpm_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_rc_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_rc_data_t packet_in = {
		963497464,
	{ 17443, 17444, 17445, 17446, 17447, 17448, 17449, 17450 },
	65,
	};
	mavlink_asctec_rc_data_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.msec = packet_in.msec;
        	packet1.lock = packet_in.lock;
        
        	mav_array_memcpy(packet1.value, packet_in.value, sizeof(uint16_t)*8);
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_rc_data_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_rc_data_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_rc_data_pack(system_id, component_id, &msg , packet1.msec , packet1.value , packet1.lock );
	mavlink_msg_asctec_rc_data_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_rc_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msec , packet1.value , packet1.lock );
	mavlink_msg_asctec_rc_data_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_rc_data_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_rc_data_send(MAVLINK_COMM_1 , packet1.msec , packet1.value , packet1.lock );
	mavlink_msg_asctec_rc_data_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_stick_command(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_stick_command_t packet_in = {
		17235,
	17339,
	17443,
	17547,
	};
	mavlink_asctec_stick_command_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.roll = packet_in.roll;
        	packet1.pitch = packet_in.pitch;
        	packet1.yaw = packet_in.yaw;
        	packet1.thrust = packet_in.thrust;
        
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_stick_command_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_stick_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_stick_command_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
	mavlink_msg_asctec_stick_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_stick_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
	mavlink_msg_asctec_stick_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_stick_command_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_stick_command_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
	mavlink_msg_asctec_stick_command_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_motor_command(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_motor_command_t packet_in = {
		963497464,
	17,
	84,
	151,
	218,
	};
	mavlink_asctec_motor_command_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.msec = packet_in.msec;
        	packet1.roll = packet_in.roll;
        	packet1.pitch = packet_in.pitch;
        	packet1.yaw = packet_in.yaw;
        	packet1.thrust = packet_in.thrust;
        
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_command_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_motor_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_command_pack(system_id, component_id, &msg , packet1.msec , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
	mavlink_msg_asctec_motor_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.msec , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
	mavlink_msg_asctec_motor_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_motor_command_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_motor_command_send(MAVLINK_COMM_1 , packet1.msec , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust );
	mavlink_msg_asctec_motor_command_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_api_command(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_message_t msg;
        uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
        uint16_t i;
	mavlink_asctec_api_command_t packet_in = {
		17235,
	17339,
	17443,
	17547,
	29,
	96,
	};
	mavlink_asctec_api_command_t packet1, packet2;
        memset(&packet1, 0, sizeof(packet1));
        	packet1.imu_pub_period = packet_in.imu_pub_period;
        	packet1.motor_rpm_pub_period = packet_in.motor_rpm_pub_period;
        	packet1.rc_data_pub_period = packet_in.rc_data_pub_period;
        	packet1.gps_data_pub_period = packet_in.gps_data_pub_period;
        	packet1.control_mode = packet_in.control_mode;
        	packet1.publishing_mode = packet_in.publishing_mode;
        
        

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_api_command_encode(system_id, component_id, &msg, &packet1);
	mavlink_msg_asctec_api_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_api_command_pack(system_id, component_id, &msg , packet1.control_mode , packet1.publishing_mode , packet1.imu_pub_period , packet1.motor_rpm_pub_period , packet1.rc_data_pub_period , packet1.gps_data_pub_period );
	mavlink_msg_asctec_api_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_api_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.control_mode , packet1.publishing_mode , packet1.imu_pub_period , packet1.motor_rpm_pub_period , packet1.rc_data_pub_period , packet1.gps_data_pub_period );
	mavlink_msg_asctec_api_command_decode(&msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);

        memset(&packet2, 0, sizeof(packet2));
        mavlink_msg_to_send_buffer(buffer, &msg);
        for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
        	comm_send_ch(MAVLINK_COMM_0, buffer[i]);
        }
	mavlink_msg_asctec_api_command_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
        
        memset(&packet2, 0, sizeof(packet2));
	mavlink_msg_asctec_api_command_send(MAVLINK_COMM_1 , packet1.control_mode , packet1.publishing_mode , packet1.imu_pub_period , packet1.motor_rpm_pub_period , packet1.rc_data_pub_period , packet1.gps_data_pub_period );
	mavlink_msg_asctec_api_command_decode(last_msg, &packet2);
        MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
}

static void mavlink_test_asctec_sdk_mavlink_types(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
{
	mavlink_test_asctec_heartbeat(system_id, component_id, last_msg);
	mavlink_test_asctec_imu(system_id, component_id, last_msg);
	mavlink_test_asctec_gps(system_id, component_id, last_msg);
	mavlink_test_asctec_motor_rpm(system_id, component_id, last_msg);
	mavlink_test_asctec_rc_data(system_id, component_id, last_msg);
	mavlink_test_asctec_stick_command(system_id, component_id, last_msg);
	mavlink_test_asctec_motor_command(system_id, component_id, last_msg);
	mavlink_test_asctec_api_command(system_id, component_id, last_msg);
}

#ifdef __cplusplus
}
#endif // __cplusplus
#endif // ASCTEC_SDK_MAVLINK_TYPES_TESTSUITE_H
